<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <h1>欢迎光临</h1>
    <h3>姓名：<span id="name"></span></h3>
    <h3>年龄：<span id="age"></span></h3>

    <script>
        // 获取URL参数
        // name ：参数名，根据参数名获取相应的参数值
        function getQueryString(name) {
            var reg = new RegExp('(^|&)' + name + '=([^&]*)(&|$)', 'i');

            var r = window.location.search.substr(1).match(reg);

            if (r != null) {
                return unescape(r[2]);
            }

            return null;
        }

        let name = getQueryString("name") ;
        let age = getQueryString("age") ;

        document.querySelector("#name").innerHTML = name ;
        document.querySelector("#age").innerHTML = age ;


        // 发起异步请求,$.ajax

    </script>
</body>

</html>